package com.hdb;

import com.hdb.dao.Hidden;
import com.hdb.dao.NeedFilter;

import javax.persistence.*;

/**
 * Created by aszer on 2016/11/12.
 */
@NeedFilter
@Entity
@Table(name = "admin", schema = "testin", catalog = "")
public class TAdmin {
    private int adminId;
    private String adminName;
    @Hidden
    private String adminPw;
    private int adminLevel;

    @Id
    @Column(name = "admin_id", nullable = false)
    public int getAdminId() {
        return adminId;
    }

    public void setAdminId(int adminId) {
        this.adminId = adminId;
    }

    @Basic
    @Column(name = "admin_name", nullable = false, length = 32)
    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    @Basic
    @Column(name = "admin_pw", nullable = false, length = 256)
    public String getAdminPw() {
        return adminPw;
    }

    public void setAdminPw(String adminPw) {
        this.adminPw = adminPw;
    }

    @Basic
    @Column(name = "admin_level", nullable = false)
    public int getAdminLevel() {
        return adminLevel;
    }

    public void setAdminLevel(int adminLevel) {
        this.adminLevel = adminLevel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TAdmin tAdmin = (TAdmin) o;

        if (adminId != tAdmin.adminId) return false;
        if (adminLevel != tAdmin.adminLevel) return false;
        if (adminName != null ? !adminName.equals(tAdmin.adminName) : tAdmin.adminName != null) return false;
        if (adminPw != null ? !adminPw.equals(tAdmin.adminPw) : tAdmin.adminPw != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = adminId;
        result = 31 * result + (adminName != null ? adminName.hashCode() : 0);
        result = 31 * result + (adminPw != null ? adminPw.hashCode() : 0);
        result = 31 * result + adminLevel;
        return result;
    }
}
